import time
from selenium import webdriver


driver = webdriver.Chrome()
# driver = webdriver.Firefox()

driver.get('https://www.xiachufang.com/explore/')


while True:
    time.sleep(5)
    food_information_list = driver.find_elements("xpath",'//div[@class="normal-recipe-list"]/ul[@class="list"]/li')
    print(food_information_list)
    for food_information in food_information_list:
        food_title = food_information.find_element("xpath",".//div[@class='info']/a").text
        food_title_url = food_information.find_element("xpath",".//div[@class='info']/a").get_attribute("href")
        food_material = food_information.find_element("xpath",".//div[@class='info pure-u']/p[@class='ing ellipsis']").text
        print(food_title,food_title_url,food_material)
    driver.find_element("xpath",'//a[@class="next"]').click()